package com.jsb.laundry.dao;

import com.jsb.laundry.model.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
 * 洗衣工厂模块
 *
 * @data 2023/3/16 13:57
 */
@Mapper
public interface LaundryFactoryVoDao {




    int updInspect(@Param("orderId") String orderId, @Param("checked") String inspect, @Param("flag") String flag);


    int updImg(@Param("orderId") String orderId, @Param("postDevelopmentPhotos") String postDevelopmentPhotos);

    int updGoodsId(@Param("goodsId") String goodsId, @Param("serveId") String serveId, @Param("orderId") String orderId);

    /**
     * 工厂出库入库检查 订单中添加检查图片
     *
     * @param orderId
     * @param picListStr
     * @param flag
     * @return
     */
    int checkClothesEnterOrOut(@Param("orderId") String orderId, @Param("picListStr") String picListStr, @Param("flag") String flag);



    /**
     * 支付成功后更新订单的信息（支付成功后，订单分配给顺丰时更新状态）
     * order_status,order_direction,pay_time,del_flag
     */
    int updLaundryOrderInfo(@Param("shopsId") String shopsId, @Param("payId") String payId, @Param("sfWaybillNo") String sfWaybillNo, @Param("type") int type, @Param("backOrderId") String back_pay_id);

    /**
     * 订单从工厂返回到用户手中
     *
     * @param userId
     * @param payId
     * @return
     */
    int updLaundryOrderInfo1(@Param("userId") String userId, @Param("payId") String payId, @Param("backOrderId") String backOrderId);


    int opColour0(@Param("name") String name, @Param("c") String c16);

    int opColour1(@Param("uuid") String uuid, @Param("name") String name, @Param("c") String c16);

    int opColour2(String uuid);

    int opACC0(String name);

    int opACC1(@Param("uuid") String uuid, @Param("name") String name);

    int opACC2(String uuid);

    int opBrand0(@Param("name") String name, @Param("pic") String pic);

    int opBrand1(@Param("uuid") String uuid, @Param("name") String name, @Param("pic") String pic);

    int opBrand2(String uuid);

    int opEffect0(String name);

    int opEffect1(@Param("uuid") String uuid, @Param("name") String name);

    int opEffect2(String uuid);

    int opFlaw0(@Param("t") String t, @Param("name") String name, @Param("pid") String pid);

    int opFlaw1(@Param("t") String t, @Param("uuid") String uuid, @Param("pid") String pid, @Param("name") String name);

    int opFlaw2(@Param("t") String t, @Param("uuid") String uuid, @Param("pid") String pid);

    HashMap findUserOrderInfo(@Param("userId") String userId, @Param("payId") String payId);


    Boolean buyCouponEd(String userId);

    List<String> findOrderIdByPayId(String payId);

    int addOrderFulfillment(JsbOrdersFulfillment ordersFulfillment);

    int addOrderFulfillmentItem(@Param("list") List<JsbOrdersFulfillmentItem> ordersFulfillmentItem);




    JsbOrdersFactory getOrdersFactoryInfo(@Param("orderId") String payId);

    /**
     * 父订单信息
     *
     * @param orderId
     * @return
     */
    JsbOrders getOrderInfo(String orderId);

    /**
     * 获取所有子订单
     *
     * @param orderId
     * @return
     */
    List<JsbOrdersItem> getSubOrderList(String orderId);

    /**
     * 订单保存到工厂
     *
     * @param ordersFactory
     * @return
     */
    Integer addOrderFactory(JsbOrdersFactory ordersFactory);

    /**
     * 订单保存到工厂item
     *
     * @param jsbOrdersFactoryItem
     * @return
     */
    int addOrderFactoryItem(@Param("list") List<JsbOrdersFactoryItem> jsbOrdersFactoryItem);

    String findByorderIds(String orderId);
}
